package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.SckcServiceljc;
import com.zr.serviceImpl.SckcServiceImplljc;

public class SckcControllerljc extends HttpServlet{
	//删除选中课程控制器
	SckcServiceljc ss = new SckcServiceImplljc();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	} 
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String cid[]=req.getParameterValues("cid[]");
		PrintWriter pw = resp.getWriter();
		for (int i = 0; i < cid.length; i++) {
			int i1 = Integer.parseInt(cid[i]);
			boolean flag = ss.deleteCouseBycid(i1);
			if(flag){
				pw.write("1");
			}else{
				pw.write("0");
			}
		}
		pw.flush();
		pw.close();
	}
}
